'use strict';

let debug = require('debug')('shop');
let mongoDao = new require('./mongo/Shop.js')();

let DaoDispatcher = function () {
};
module.exports = new DaoDispatcher();
let theProto = DaoDispatcher.prototype;

/**
 * 添加单个
 * @param inParams
 * @returns {*}
 */
theProto.addOne = function*(inParams) {
    let result = yield mongoDao.save(inParams);
    return result;
};

/**
 *
 * @param id
 * @returns {*}
 */
theProto.findById = function*(id) {
    let result = yield mongoDao.findById(id);
    return result;
};

/**
 * @param idList
 */
theProto.findByIdList = function *(idList) {
    let result = yield mongoDao.findByIdList(idList);
    return result;
};

/**
 * @param idList
 */
theProto.updateCates = function *(idList, cates) {
    let result = yield mongoDao.updateCates(idList, cates);
    return result;
};